﻿using System;
using System.IO;
using System.Net;

namespace SBPweb.PhotoGallery.Common
{

    public class DownloadEventArgs : EventArgs
    {

        public DownloadEventArgs(DownloadItem item)
        {
            this.Item = item;
        }

        public DownloadItem Item;

    }

    public class DownloadErrorEventArgs : DownloadEventArgs
    {

        public DownloadErrorEventArgs(DownloadItem item, Exception error)
            : base(item)
        {
            this.Error = error;
        }

        public Exception Error;

    }

    public class DownloadStreamEventArgs : DownloadEventArgs
    {

        public DownloadStreamEventArgs(DownloadItem item, Stream stream)
            : base(item)
        {
            this.Stream = stream;
        }

        public Stream Stream;

    }

    public class DownloadProgressEventArgs : DownloadEventArgs
    {

        public DownloadProgressEventArgs(DownloadItem item)
            : base(item)
        {
            this.BytesReceived = 0;
            this.ProgressPercentage = 0;
            this.TotalBytesToReceive = 0;
        }

        public DownloadProgressEventArgs(DownloadItem item, DownloadProgressChangedEventArgs e)
            : base(item)
        {
            this.BytesReceived = e.BytesReceived;
            this.ProgressPercentage = e.ProgressPercentage;
            this.TotalBytesToReceive = e.TotalBytesToReceive;
        }

        public long BytesReceived;

        public long TotalBytesToReceive;

        public int ProgressPercentage;

    }
}